from selenium.webdriver.common.by import By
from time import sleep
from lx4102.Page import Page
class Page1(Page):
    djdlff = (By.XPATH, '/html/body/div[2]/div/div[1]/div/a[1]')
    def djdl(self):
        self.click(self.djdlff)

    dlzhff = (By.ID, 'userName')
    def srzh(self):
        self.send_keys(self.dlzhff, '17733058407')

    dlmmff = (By.ID, 'password')
    def dlmm(self):
        self.send_keys(self.dlmmff, 'Li10140910')

    qrdlff = (By.NAME, 'bi_Usuallogin')
    def qrdl(self):
        self.click(self.qrdlff)

    qdff = (By.ID, 'bindSub')
    def qd(self):
        self.click(self.qdff)

    wly=(By.XPATH,'/html/body/div[4]/div/div[2]/div[2]/p/a[2]')
    def wulian(self):
        self.click(self.wly)

    def gundong(self):
        self.scrollTo_div(200)

    #点击五粮液
    dianji=(By.XPATH,'/html/body/div[6]/div/div[2]/div[6]/ul/li[4]/div[2]/div[1]/a/img')
    def djwly(self):
        self.click(self.dianji)
    #加入购物车
    addshop=(By.NAME,'detail_jiarugouwuche')
    def add(self):
        self.click(self.addshop)




    def luoji_login_02(self):
        self.open_url('https://www.jiuxian.com/')
        sleep(2)
        self.djdl()
        sleep(2)
        self.srzh()
        sleep(2)
        self.dlmm()
        sleep(10)
        self.qrdl()
        sleep(2)
        self.qd()
        sleep(2)
        self.wulian()
        self.new_window()
        sleep(2)
        self.gundong()
        self.add()
        sleep(5)



